<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试Interval</title>
</head>
<body>
<script src="https://unpkg.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script>
<script>
	let source = Rx.Observable
		.interval(1000)
		.take(5);
	
	let subscription =source.subscribe(
		function (x) {
			console.log('Next:'+x);
		},
		function (err) {
			console.log('Error:'+err);
		},
		function () {
			console.log('finish');
		}
	)
</script>
</body>
</html>